﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Web.Function;

namespace Web
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        private string getAspxPath()
        {
            return Server.MapPath("~");
        }

        /// <summary>
        /// 获得Js列表
        /// </summary>
        public string getJsList()
        {
            if (CacheManager.Contains("JsList"))
            {
                return CacheManager.GetCache<string>("JsList");
            }
            else
            {
                FileList dir = new FileList(getAspxPath());
                string list = dir.GetJsList("Js/");
                return CacheManager.SetCache("JsList", list);
            }
        }

        /// <summary>
        /// 获得Css列表
        /// </summary>
        public string getCssList()
        {
            if (CacheManager.Contains("CssList"))
            {
                return CacheManager.GetCache<string>("CssList");
            }
            else
            {
                FileList dir = new FileList(getAspxPath());
                string list = dir.GetCssList("Inc/Css/");
                return CacheManager.SetCache("CssList", list);
            }
        }
    }
}
